package com.estore.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.jdbc.core.RowMapper;

import com.estore.entity.Discount;

public class DiscountMapper implements RowMapper<Discount> {

	@Override
	public Discount mapRow(ResultSet rs, int arg1) throws SQLException {
		Discount discount = new Discount();
		discount.setListID(rs.getInt("listID"));
		discount.setStartDate(rs.getString("startDate"));
		discount.setEndDate(rs.getString("endDate"));
		discount.setDuration(rs.getInt("duration"));
		discount.setDiscount(rs.getFloat("discount"));
		return discount;
	}

}
